#!/bin/bash
CURDIR="`pwd`"/"`dirname $0`" # 输出脚本调用路径
echo $CURDIR

COPY_FROM_PATH="$CURDIR/dist"
TARGET_PATH="$CURDIR/../../test_folder"
function copyFolder(){
    if [ -d "$TARGET_PATH" ]; then
        echo "有啊"
        rm -r "${TARGET_PATH}"
        mkdir "${TARGET_PATH}"
        cp -r "${COPY_FROM_PATH}/*" "${TARGET_PATH}"
        echo "copy ${COPY_FROM_PATH} 到${TARGET_PATH}"
    else
        echo "没有文件夹 ${TARGET_PATH}"
    fi
}
function pause (){
    # 暂停执行
    read -p "按回车键继续"
}
copyFolder
pause